﻿@using myTutor.Models
@model Config

@{
    ViewBag.Title = "Quản trị thông số hệ thống";
    
    List<int> slideIntervals = new List<int>();
    for (int i = 1; i < 61; i++)
    {
        slideIntervals.Add(i);
    }
}

<style type="text/css">
    .tblConfig input[type="text"],.tblConfig input[type="password"]{width:400px;}
    .tblConfig select{width:406px;}
</style>

<h2>Quản trị thông số hệ thống</h2>
<span style="color:Red; padding-bottom:20px; margin-left:150px;"><strong>@ViewBag.Message</strong></span><p></p>
<span style="color:#01A3E1; padding-bottom:20px; margin-left:300px;"><strong>LƯU Ý:</strong> Các trường có dấu (*) là bắt buộc</span>
<p>
    @using (Html.BeginForm())
    {
    @Html.ValidationSummary(true, "Thông tin chưa được ghi nhận. Vui lòng kiểm tra lại!", new { style = "padding-bottom:20px; margin-left:150px;" })
    <table class="tblConfig" style="margin-left:150px;">
        <tbody>
            <tr>
                <td colspan="2">
                    <span style="color:#01a3e1; font-weight:bolder;">THÔNG TIN CHUNG</span>
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.PreSiteName) (*): </td>
                <td>
                    @Html.TextBoxFor(m => m.PreSiteName)<br />
                    @Html.ValidationMessageFor(m => m.PreSiteName)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.SiteName) (*): </td>
                <td>
                    @Html.TextBoxFor(m => m.SiteName)<br />
                    @Html.ValidationMessageFor(m => m.SiteName)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.ContactName01) (*) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactName01)<br />
                    @Html.ValidationMessageFor(m => m.ContactName01)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.ContactAddress01) (*) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactAddress01)<br />
                    @Html.ValidationMessageFor(m => m.ContactAddress01)
                </td>
            </tr>   
            <tr>
                <td>@Html.LabelFor(m => m.ContactPhone01) (*) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactPhone01)<br />
                    @Html.ValidationMessageFor(m => m.ContactPhone01)
                </td>
            </tr>             
            <tr>
                <td>@Html.LabelFor(m => m.ContactYahoo01) (*) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactYahoo01)<br />
                    @Html.ValidationMessageFor(m => m.ContactYahoo01)
                </td>
            </tr>  
            <tr>
                <td>@Html.LabelFor(m => m.ContactName02) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactName02)<br />
                    @Html.ValidationMessageFor(m => m.ContactName02)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.ContactAddress02) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactAddress02)<br />
                    @Html.ValidationMessageFor(m => m.ContactAddress02)
                </td>
            </tr>   
            <tr>
                <td>@Html.LabelFor(m => m.ContactPhone02) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactPhone02)<br />
                    @Html.ValidationMessageFor(m => m.ContactPhone02)
                </td>
            </tr>             
            <tr>
                <td>@Html.LabelFor(m => m.ContactYahoo02) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactYahoo02)<br />
                    @Html.ValidationMessageFor(m => m.ContactYahoo02)
                </td>
            </tr> 
            <tr>
                <td>@Html.LabelFor(m => m.ContactName03) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactName03)<br />
                    @Html.ValidationMessageFor(m => m.ContactName03)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.ContactAddress03) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactAddress03)<br />
                    @Html.ValidationMessageFor(m => m.ContactAddress03)
                </td>
            </tr>   
            <tr>
                <td>@Html.LabelFor(m => m.ContactPhone03) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactPhone03)<br />
                    @Html.ValidationMessageFor(m => m.ContactPhone03)
                </td>
            </tr>             
            <tr>
                <td>@Html.LabelFor(m => m.ContactYahoo03) </td>
                <td>
                    @Html.TextBoxFor(m => m.ContactYahoo03)<br />
                    @Html.ValidationMessageFor(m => m.ContactYahoo03)
                </td>
            </tr>             
            <tr>
                <td colspan="2">
                    <span style="color:#01a3e1; font-weight:bolder;">CẤU HÌNH WEBMAIL</span>
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.SmtpServer) (*): </td>
                <td>
                    @Html.TextBoxFor(m => m.SmtpServer)<br />
                    @Html.ValidationMessageFor(m => m.SmtpServer)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.SmtpServerUserName) (*): </td>
                <td>
                    @Html.TextBoxFor(m => m.SmtpServerUserName)<br />
                    @Html.ValidationMessageFor(m => m.SmtpServerUserName)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.SmtpServerPassword) (*) </td>
                <td>
                    @Html.PasswordFor(m => m.SmtpServerPassword)<br />
                    @Html.ValidationMessageFor(m => m.SmtpServerPassword)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.SmtpServerFrom) (*) </td>
                <td>
                    @Html.TextBoxFor(m => m.SmtpServerFrom)<br />
                    @Html.ValidationMessageFor(m => m.SmtpServerFrom)
                </td>
            </tr>            
            <tr>
                <td>@Html.LabelFor(m => m.SmtpServerTo) (*) </td>
                <td>
                    @Html.TextBoxFor(m => m.SmtpServerTo)<br />
                    @Html.ValidationMessageFor(m => m.SmtpServerTo)
                </td>
            </tr>  
            <tr>
                <td colspan="2">
                    <span style="color:#01a3e1; font-weight:bolder;">QUẢN TRỊ TÀI KHOẢN</span>
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.RequireEmailConfirmation) (*): </td>
                <td>
                    @Html.RadioButtonFor(m => m.RequireEmailConfirmation, "true") Có @Html.RadioButtonFor(m => m.RequireEmailConfirmation, "false") Không<br />
                    @Html.ValidationMessageFor(m => m.RequireEmailConfirmation)
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <span style="color:#01a3e1; font-weight:bolder;">TRUY VẤN DỮ LIỆU</span>
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.NumOfTopClasses) (*): </td>
                <td>
                    @{List<int> numClasses = new List<int>(); numClasses.Add(Config.GetNumOfTopClassesInRow()); numClasses.Add(2 * Config.GetNumOfTopClassesInRow()); numClasses.Add(3 * Config.GetNumOfTopClassesInRow()); numClasses.Add(4 * Config.GetNumOfTopClassesInRow()); numClasses.Add(5 * Config.GetNumOfTopClassesInRow());}
                    @Html.DropDownListFor(m => m.NumOfTopClasses, new SelectList(numClasses))<br />
                    @Html.ValidationMessageFor(m => m.NumOfTopClasses)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.NumOfTopTutors) (*): </td>
                <td>
                     @{List<int> numTutors = new List<int>(); numTutors.Add(Config.GetNumOfTopTutorsInRow()); numTutors.Add(2 * Config.GetNumOfTopTutorsInRow()); numTutors.Add(3 * Config.GetNumOfTopTutorsInRow()); numTutors.Add(4 * Config.GetNumOfTopTutorsInRow()); numTutors.Add(5 * Config.GetNumOfTopTutorsInRow());}
                    @Html.DropDownListFor(m => m.NumOfTopTutors, new SelectList(numTutors))<br />
                    @Html.ValidationMessageFor(m => m.NumOfTopTutors)
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <span style="color:#01a3e1; font-weight:bolder;">HIỂN THỊ QUẢNG CÁO</span>
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.SlideAdvertising) (*): </td>
                <td>
                    @Html.RadioButtonFor(m => m.SlideAdvertising, "true") Có @Html.RadioButtonFor(m => m.SlideAdvertising, "false") Không<br />
                    @Html.ValidationMessageFor(m => m.SlideAdvertising)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.SlideAdsInterval) (*): </td>
                <td>
                    @Html.DropDownListFor(m => m.SlideAdsInterval, new SelectList(slideIntervals))<br />
                    @Html.ValidationMessageFor(m => m.SlideAdsInterval)
                </td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.SlideAdsStep) (*) </td>
                <td>
                    @Html.TextBoxFor(m => m.SlideAdsStep)<br />
                    @Html.ValidationMessageFor(m => m.SlideAdsStep)
                </td>
            </tr>  
            <tr>
                <td>@Html.LabelFor(m => m.KeepOldAds) (*): </td>
                <td>
                    @Html.RadioButtonFor(m => m.KeepOldAds, "true") Có @Html.RadioButtonFor(m => m.KeepOldAds, "false") Không<br />
                    @Html.ValidationMessageFor(m => m.KeepOldAds)
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <p style="float:right; padding-top:2px;"><strong><span class="submit-img but-blue"><span class="icon icon-search"></span><input type="submit" class="but-submit submit-blue" value="Lưu thay đổi" /></span></strong></p>
                </td>
            </tr>
        </tbody>
    </table>
    }
</p>
